<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: D:/Projects/MiXiM/extsrc/mixim/src/modules/phy/SNRThresholdDecider.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00481.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">SNRThresholdDecider.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef SNRTHRESHOLDDECIDER_H_</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define SNRTHRESHOLDDECIDER_H_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;MiXiMDefs.h&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;BaseDecider.h&quot;</span>
<a name="l00006"></a>00006 
<a name="l00036"></a><a class="code" href="a00203.html">00036</a> <span class="keyword">class </span>MIXIM_API <a class="code" href="a00203.html" title="Decider implementation which decides a signals correctness by checking its SNR against a threshold...">SNRThresholdDecider</a> : <span class="keyword">public</span> <a class="code" href="a00020.html" title="Provides some base functionality for most common deciders.">BaseDecider</a>
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 <span class="keyword">protected</span>:
<a name="l00040"></a><a class="code" href="a00203.html#abdb6b19743460a19e900c4b6d38c483b">00040</a>   <span class="keywordtype">double</span> <a class="code" href="a00203.html#abdb6b19743460a19e900c4b6d38c483b" title="Threshold value for checking a SNR-map (SNR-threshold).">snrThreshold</a>;
<a name="l00041"></a>00041 
<a name="l00043"></a><a class="code" href="a00203.html#a8f32acd24c8c84efee941211d1f81c98">00043</a>   <span class="keywordtype">double</span> <a class="code" href="a00203.html#a8f32acd24c8c84efee941211d1f81c98" title="The threshold rssi level above which the channel is considered busy.">busyThreshold</a>;
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="keyword">protected</span>:
<a name="l00046"></a>00046 
<a name="l00055"></a>00055   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> checkIfAboveThreshold(<a class="code" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a>* map, simtime_t_cref start, simtime_t_cref end) <span class="keyword">const</span>;
<a name="l00056"></a>00056 
<a name="l00066"></a>00066   <span class="keyword">virtual</span> <a class="code" href="a00075.html" title="A class to represent the result of a processed packet (that is not noise) by the Decider.">DeciderResult</a>* <a class="code" href="a00020.html#ac6ef3a4cf1b91bcec788b540d61bfeba" title="Creates the DeciderResult from frame.">createResult</a>(<span class="keyword">const</span> <a class="code" href="a00070.html#a8532046253d31801ffe4bc56b0d70850">airframe_ptr_t</a> frame) <span class="keyword">const</span>;
<a name="l00067"></a>00067 
<a name="l00072"></a>00072   <span class="keyword">virtual</span> simtime_t <a class="code" href="a00020.html#ab6c1c16f5d0f3c18dd029aa9cac256a6" title="Returns point in time when the ChannelSenseRequest of the passed CSRInfo can be answered (e...">canAnswerCSR</a>(<span class="keyword">const</span> <a class="code" href="a00206.html" title="Data about an currently ongoing ChannelSenseRequest.">CSRInfo</a>&amp; requestInfo) <span class="keyword">const</span>;
<a name="l00073"></a>00073 
<a name="l00080"></a>00080   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00020.html#ab8e925001d1f8630338c50f8ec10bb0d" title="Answers the ChannelSenseRequest (CSR) from the passed CSRInfo.">answerCSR</a>(<a class="code" href="a00206.html" title="Data about an currently ongoing ChannelSenseRequest.">CSRInfo</a>&amp; requestInfo);
<a name="l00081"></a>00081 
<a name="l00087"></a><a class="code" href="a00203.html#ae900f58c344f86cea2dbf21b55a74d85">00087</a>   <span class="keywordtype">bool</span> <a class="code" href="a00203.html#ae900f58c344f86cea2dbf21b55a74d85" title="Returns whether the passed rssi value indicates a idle channel.">isIdleRSSI</a>(<span class="keywordtype">double</span> rssi)<span class="keyword"> const </span>{
<a name="l00088"></a>00088     <span class="keywordflow">return</span> rssi &lt;= busyThreshold;
<a name="l00089"></a>00089   }
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 <span class="keyword">public</span>:
<a name="l00092"></a>00092 
<a name="l00106"></a><a class="code" href="a00203.html#aad17421c20bd89d6670ab110558a2479">00106</a>   <a class="code" href="a00203.html" title="Decider implementation which decides a signals correctness by checking its SNR against a threshold...">SNRThresholdDecider</a>( <a class="code" href="a00079.html" title="This class is the interface for a Decider to the BasePhyLayer.">DeciderToPhyInterface</a>* phy
<a name="l00107"></a>00107                      , <span class="keywordtype">double</span>                 sensitivity
<a name="l00108"></a>00108                      , <span class="keywordtype">int</span>                    myIndex = -1
<a name="l00109"></a>00109                      , <span class="keywordtype">bool</span>                   debug   = <span class="keyword">false</span>)
<a name="l00110"></a>00110     : <a class="code" href="a00020.html" title="Provides some base functionality for most common deciders.">BaseDecider</a>(phy, sensitivity, myIndex, debug)
<a name="l00111"></a>00111     , snrThreshold(0)
<a name="l00112"></a>00112     , busyThreshold(sensitivity)
<a name="l00113"></a>00113   {}
<a name="l00114"></a>00114 
<a name="l00123"></a>00123   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="a00070.html#ae19a201633e5b2bf2d545921049b4f26" title="Initialize the decider from XML map data.">initFromMap</a>(<span class="keyword">const</span> ParameterMap&amp; params);
<a name="l00124"></a>00124 
<a name="l00125"></a>00125   <span class="keyword">virtual</span> ~<a class="code" href="a00203.html" title="Decider implementation which decides a signals correctness by checking its SNR against a threshold...">SNRThresholdDecider</a>() {};
<a name="l00126"></a>00126 
<a name="l00134"></a>00134   <span class="keyword">virtual</span> <a class="code" href="a00044.html" title="Provides information about the current state of the channel:">ChannelState</a> <a class="code" href="a00020.html#a35e3f8f4e683747fbec1618ee1608982" title="A function that returns information about the channel state.">getChannelState</a>() <span class="keyword">const</span>;
<a name="l00135"></a>00135 };
<a name="l00136"></a>00136 
<a name="l00137"></a>00137 <span class="preprocessor">#endif </span><span class="comment">/* SNRTHRESHOLDDECIDER_H_ */</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>SNRThresholdDecider.h</b>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:30 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
